#ifndef _lonon_max7219_h_
#define _lonon_max7219_h_
              
#define MAX7219_POWER_ON			1
#define MAX7219_POWER_OFF			0

#define MAX7219_POWER_NUM		    GPIO_NUM_21
#define MAX7219_POWER_OUT           gpio_set_direction(MAX7219_POWER_NUM,GPIO_MODE_OUTPUT);
#define MAX7219_POWER_1             gpio_set_level(MAX7219_POWER_NUM,1);
#define MAX7219_POWER_0             gpio_set_level(MAX7219_POWER_NUM,0);

#define MAX7219_PIN_CLK_NUM		    GPIO_NUM_5
#define MAX7219_PIN_CLK_OUT         gpio_set_direction(MAX7219_PIN_CLK_NUM,GPIO_MODE_OUTPUT);
#define MAX7219_PIN_CLK_1           gpio_set_level(MAX7219_PIN_CLK_NUM,1);
#define MAX7219_PIN_CLK_0           gpio_set_level(MAX7219_PIN_CLK_NUM,0);

#define MAX7219_PIN_CS_NUM		    GPIO_NUM_18
#define MAX7219_PIN_CS_OUT          gpio_set_direction(MAX7219_PIN_CS_NUM,GPIO_MODE_OUTPUT);
#define MAX7219_PIN_CS_1            gpio_set_level(MAX7219_PIN_CS_NUM,1);
#define MAX7219_PIN_CS_0            gpio_set_level(MAX7219_PIN_CS_NUM,0);

#define MAX7219_PIN_DIN_NUM		    GPIO_NUM_19
#define MAX7219_PIN_DIN_OUT         gpio_set_direction(MAX7219_PIN_DIN_NUM,GPIO_MODE_OUTPUT);
#define MAX7219_PIN_DIN_1           gpio_set_level(MAX7219_PIN_DIN_NUM,1);
#define MAX7219_PIN_DIN_0           gpio_set_level(MAX7219_PIN_DIN_NUM,0);


#define MAX_7219_NUMBER				12	


void MAX7219_POWER_SWITCH(unsigned char i);

void MAX7219_RESET(void);

void Sleep_MAX7219(void);

void Init_MAX7219(void);

void KeepSeting_MAX7219(void);

void Write_Max7219(unsigned char address1,unsigned char dat1);

void Write_Max7219_byte(unsigned char DATA);







#endif








